//
// Created by shenbin on 2022/5/7.
//

#ifndef ALGORITHM_TRAINNING_C04_LC78_H
#define ALGORITHM_TRAINNING_C04_LC78_H

#include <vector>

using namespace std;

class LeetCode78 {
public:
    vector<vector<int>> subsets(vector<int> nums) {
        n = nums.size();
        recur(0, nums);
        return ans;

    }

private:
    int n;
    vector<int> chosen;
    vector<vector<int>> ans;

    void recur(int i, vector<int> &nums) {
        // 递归边界
        if (i == n) {
            ans.push_back(chosen);
            return
        }
        // 选
        recur(i + 1, nums);
        chosen.push_back(nums[i])
        recur(i + 1, nums)
        // 还原现场
        chosen.pop_back();
    }
};

#endif //ALGORITHM_TRAINNING_C04_LC78_H
